                        <!-- Script réalisé par BOUFTIH Fadwa -->
{extends file="skulton.tpl"}{/extends}
{block name="monblock"}
<script src="scripts/js/Form.js"></script>
<script type="text/javascript" charset="utf-8">
	var asInitVals = new Array();
	$(document).ready(function() {
//dialog de suppression
		  $(".yesno").click(function(){
				var a = $(this);
				$( "#dialog-confirm" ).dialog({
						resizable: false,
						modal: true,
						buttons: {
							"Oui": function() {
								
								document.location.href="reclamation.php?id_sup="+a.attr('id');
							},
							"Non": function() {
								$( this ).dialog( "close" );
							}
						}
				});
			});
/***affichage dialog de confirmation xsl*/
          $(".rep").click(function(){
                  var a = $(this);
                  $( "#dialog-confirmXSL" ).dialog({
                          resizable: false,
                          modal: true,
                          buttons: {
                            "Générer": function() {
                
                              document.location.href="genererXSL.php?&page=reclamation";
                            },
                            "non": function() {
                              $( this ).dialog( "close" );
                            }
                        }              
                });
            });
//dataTable
		var oTable = $('#idtable').dataTable( {
			"sPaginationType": "full_numbers",
			"oLanguage": {
				"sSearch": "Rechercher:"
			}
		} );
		//recherche spécifique à la colone
		$("tfoot input").keyup( function () {
			/* Filter on the column (the index) of this element */
			oTable.fnFilter( this.value, $("tfoot input").index(this) );
		} );
		//footer de dataTable
		$("tfoot input").each( function (i) {
			asInitVals[i] = this.value;
		} );
		 
		$("tfoot input").focus( function () {
			if ( this.className == "search_init" )
			{
				this.className = "";
				this.value = "";
			}
		} );
		 
		$("tfoot input").blur( function (i) {
			if ( this.value == "" )
			{
				this.className = "search_init";
				this.value = asInitVals[$("tfoot input").index(this)];
			}
		} );
				
	} );
</script>

	
<div class="content-box"><!-- body-->
	
	<div class="content-box-header">
		
		<h3>Liste des reclamations</h3>

	    <a href="generePDF.php?&page=reclamation"  style='margin-left:10px;'><img src="images/icons/PDF.png" >    </a>
        <a href="#" class="rep" style='margin-left:10px;'><img src="images/icons/excel.png" ></a>
		
	</div> <!-- End .content-box-:>header -->  
	
	<div class="tab-content default-tab" id="tab1"> 
		{if isset($message)}
			<div class="notification success png_bg">
				<a href="#" class="close"><img src="images/icons/cross_grey_small.png" title="Close this notification" alt="close"></a>
				<div>
					{$message}
				</div>
			</div>
		{/if}	
			
	        <div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
	        	<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
	        </div>
             <!--confirmer la generation XSL avec un dialog-->
            <div style="display:none;" id="dialog-confirmXSL" title="Demande de confirmation">
              <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment générer ce fichier dans le bureau ?</p>
            </div>
	
			<table id="idtable">
				
				<thead>
					<tr>
					   <th><input class="check-all" type="checkbox" /></th>
					   <th>Description du problème<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Désignation de la tache<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Date Reclamation<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
					   <th>Etat</th>
					   <th>Nomade</th>
					   <th>Suppression</th>
					</tr>
				</thead>
			
				<tbody>
				  {foreach $return as $reclamation}
					<tr>	
						<td><input type="checkbox" /></td>
						<td>{$reclamation->getDescription()}</td>
						<td>{$reclamation->getDesignation()}</td>
						<td>{$reclamation->getDateReclamation()}</td>
						<td>{if $reclamation->getEtat()==-1}
				            <img src="images/icons/checked1.png" alt="vu">
				            {else}
				            non vu
				            {/if}
				        </td>
					    <td>{$nomadeDao->loadNomade($reclamation->getIdNomade())->getNom()} {$nomadeDao->loadNomade($reclamation->getIdNomade())->getPrenom() }</td>
						<td>	
							<a href="#" title="Delete" class="yesno with-tip supp" id="{$reclamation->getIdReclamation()}"><img src="images/icons/cross.png" alt="Delete" /></a>    
						</td>
					</tr>
				  {/foreach}
				</tbody>
				
				<tfoot>
					<tr>
						<th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
						
						<th><input type="text" name="search_description" value="" class="search_int" /></th>
						<th><input type="text" name="search_designation" value="" class="search_int" /></th>
						<th><input type="text" name="search_dateReclamation" value="" class="search_int"  /></th>
						<th><input type="text" name="search_idNomade" value="" class="search_int"  /></th>
						<th><input type="text" name="search_etat" value="" class="search_int" style="display:none" /></th>
					</tr>
				</tfoot>
				
			</table>
			
		</div> <!-- fin #tab2 -->        
		
	</div> <!-- fin .content-box-content -->

{/block}